import { createRouter, createWebHashHistory } from 'vue-router'
// 首页
const Layout = () => import('@/views/Layout')
// 首页
const Home = () => import('@/views/Home')
// 测试
const Playground = () => import('@/views/Playground')
// Category
const Category = () => import('@/views/Category')
const SubCategory = () => import('@/views/Category/sub')

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        component: Home
      },
      {
        path: 'play',
        component: Playground
      },
      {
        path: '/category/:id',
        component: Category
      },
      {
        path: '/subCategory/:id',
        component: SubCategory
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
